package com.woniuxy.rabbitmqspringboot.simple;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author zhangyong
 * @Date 2021/8/12 0012上午 11:35
 */
@Component
public class Productor {
    @Resource
    private AmqpTemplate amqpTemplate;

    //发送消息
    public void send(String data){
        //参数1：队列名
        amqpTemplate.convertAndSend("boot_simple_work",data);
    }
}
